//
//  BKMyOrderChooseEvaluatingCellTableViewCell.m
//  bestkeep
//
//  Created by mac on 16/12/16.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "BKMyOrderChooseEvaluatingCell.h"

#import "BK_OD_Color.h"
#import "BK_OD_Tool.h"
@implementation BKMyOrderChooseEvaluatingCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _goodsImg = [UIImageView new];
        _goodsImg.layer.borderWidth = 0.5;
        _goodsImg.layer.borderColor = RGB(221,221, 221).CGColor;
        [self.contentView addSubview:_goodsImg];
        [_goodsImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView.mas_left).offset(10);
            make.top.mas_equalTo(self.contentView.mas_top).offset(10);
            make.height.equalTo(@(90));
            make.width.equalTo(@(90));
        }];
        
        _goodsName = [UILabel new];
        _goodsName.textColor = RGB(38, 38, 38);
        _goodsName.font = [UIFont systemFontOfSize:14.0];
        _goodsName.numberOfLines = 0;
        
        _goodsName.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_goodsName];
        
        [_goodsName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.contentView.mas_top).offset(10);
            make.left.mas_equalTo(_goodsImg.mas_right).offset(10);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
            make.height.equalTo(@(40));
        }];
        
        _goodsPro = [UILabel new];
        _goodsPro.textColor = [UIColor grayColor];
        _goodsPro.font = [UIFont systemFontOfSize:12.0];
        _goodsPro.numberOfLines=1;
        _goodsPro.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_goodsPro];
        
        [_goodsPro mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(_goodsName.mas_bottom).offset(5);
            make.left.mas_equalTo(_goodsImg.mas_right).offset(10);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
            make.height.equalTo(@(14));
        }];
        
        _evaluteBu = [UIButton new];
        _evaluteBu.backgroundColor = [UIColor whiteColor];
        _evaluteBu.layer.borderWidth = 0.5;
        _evaluteBu.layer.borderColor = [UIColor colorWithRed:0.135 green:0.685 blue:0.553 alpha:1.000].CGColor ;
        [_evaluteBu setTitle:@"评价晒单" forState:UIControlStateNormal];
        _evaluteBu.titleLabel.font = [UIFont systemFontOfSize:14];
        [_evaluteBu setTitleColor:kOrderBKGreen forState:UIControlStateNormal];
        [self.contentView addSubview:_evaluteBu];
        [_evaluteBu mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-10);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
            make.height.equalTo(@(25));
            make.width.equalTo(@(75));
        }];
        _lien =[UIView new];
        _lien.backgroundColor=[UIColor colorWithWhite:0.800 alpha:1.000];
        [self.contentView addSubview:_lien];
        [_lien mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_goodsImg.mas_left).offset(-30);
            make.right.equalTo(self.contentView.mas_right);
            make.bottom.equalTo(self.contentView.mas_bottom);
            make.height.equalTo(@(0.4));
        }];//2016年05月17日08:23:01
        
    }
    return self;
}
-(void)setModel:(BKMyOrderEvalutingCountModel *)model{
    
        _model = model;
        [_goodsImg load:model.goodsImg];
        _goodsName.text = model.goodsName;
        _goodsPro.text = @"";
    for (goodsPrRel *pr in model.goodsPrRel) {
        NSString *str1 = pr.proName;
        NSString *str2 = pr.proValue;
        NSString *str = [str1 stringByAppendingString:@":"];
        NSString *string1 = [str stringByAppendingString:str2];
        _goodsPro.text = [ _goodsPro.text stringByAppendingString:string1];
    }
        }
@end

